<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="dist/vue.js"></script>
    <style>
        .coloractive{
            color: red;
        }
        .bgactive {
            background-color:aliceblue;
        }
    </style>
</head>
<body>
    <div id="app">
        <p class="coloractive bgactive">你说啥呀</p>
        <p :class="[testClass,bgClass]">我说这个</p> 
        <!-- [] 括号变量之间必须要有逗号 -->
    </div>
</body>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            testClass: 'coloractive', //必须要加引号
            bgClass: 'bgactive'   //必须要加引号
        }
    })
</script>
</html>